package cn.afterturn.svn.analysis.controller.userinfo;

import org.nutz.dao.QueryResult;
import org.nutz.dao.pager.Pager;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.slf4j.Logger;

import cn.afterturn.svn.analysis.entity.userinfo.UserInfoEntity;
import cn.afterturn.svn.analysis.service.userinfo.UserInfoService;

/**
 * svn  用户账号
 * @author JueYue
 * @date 2015-07-29 15:41
 * @version V1.0  
 */
@At("/userinfo")
public class UserInfoController {

    private static final Log LOGGER = Logs.get();

    @Inject
    private UserInfoService userInfoService;

    @At
    @Ok("jsp:userinfo/userInfoList")
    public void home(UserInfoEntity entity) {
    }

    @At("/userinfo_list.htm")
    @Ok("json")
    public QueryResult UserInfoList(UserInfoEntity entity, Pager pager) {
        QueryResult list = null;
        try {
            list = userInfoService.getUserInfoPage(entity, pager);
        } catch (Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return list;
    }
}
